<?php

namespace app\controller;

use app\BaseController;
use app\middleware\Sender;
use app\service\Factory;
use app\service\message\receive\normal\File;
use app\util\MeiliSearch;

class Index extends BaseController
{
    // protected $middleware = [Sender::class];
    public function index() {
        $param = input();
        trace($param, 'input.param');
        $head = $param['header'];
        $message = $param['event']['message'];
        $event = Factory::{$head['eventType'].".".ucfirst($message['contentType'])}($param);
        /**
         * @var $event \app\yhUtil\type\Base
         */
        $res = $event->run();
        return $res;
    }

    public function test(){
        $ms = new MeiliSearch([]);
    }
}


